home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / ExploB.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.1 KB  |  45 lines

  1. class classes.fx.ExploB
  2. {
  3.    var id;
  4.    var x;
  5.    var y;
  6.    var scale;
  7.    var a;
  8.    var typeVar;
  9.    var dir;
  10.    var clip;
  11.    var c = 0;
  12.    var power = 50;
  13.    var Name = "exploB";
  14.    function ExploB(px, py, pscale, pa, ptypeVar, pid)
  15.    {
  16.       this.id = pid;
  17.       this.x = px;
  18.       this.y = py;
  19.       this.scale = pscale;
  20.       this.a = pa;
  21.       this.typeVar = ptypeVar;
  22.       var _loc3_ = ["L","R","U","D"];
  23.       this.dir = _loc3_[random(4)];
  24.       _root.d = _root.d + 1;
  25.       this.clip = _root.attachMovie("explo" + this.typeVar,"exploB" + this.id + "Clip",_root.d);
  26.       this.clip._x = this.x;
  27.       this.clip._y = this.y;
  28.       this.clip._xscale = this.scale;
  29.       this.clip._yscale = this.scale;
  30.       this.clip._alpha = this.a;
  31.    }
  32.    function main()
  33.    {
  34.       this.c = this.c + 1;
  35.       if(this.clip.hitTest(_root[_root.char + "Clip"]))
  36.       {
  37.          _root[_root.char].hit(_root.randRange(-9,9),_root.randRange(-9,9),this.scale - this.c,this.power - this.c / 3);
  38.       }
  39.       if(this.clip.end)
  40.       {
  41.          _root.removeEnemyShot("exploB" + this.id);
  42.       }
  43.    }
  44. }
  45.